package com.chengliang.bbs.mapper;

import com.chengliang.bbs.common.MyBaseMapper;
import com.chengliang.bbs.entry.Reply;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 回复
 *
 * @author chengliang
 */
public interface ReplyMapper extends MyBaseMapper<Reply> {

    /**
     * 根据帖子ID 查询回复列表
     *
     * @param jieId
     * @return
     */
    List<Reply> selectReplyByJieId(Integer jieId);

    /**
     * 添加回复
     * @return
     */
    boolean insertReply(Reply reply);

    /**
     * 修改采纳状态
     *
     * @param replyId 回复ID
     * @return
     */
    boolean updateAdoptStatus(@Param("replyId") Integer replyId, @Param("adoptStatus") boolean adoptStatus);

    /**
     * 修改删除状态
     *
     * @param replyId
     * @return
     */
    boolean updateDeleteStatusByReplyId(@Param("replyId") Integer replyId, @Param("delete") boolean delete);

    /**
     * 查询未删除回复
     * @param userId
     * @return
     */
    List<Reply> selectReplyListByUserId(Integer userId);
}
